package thread;


public class ThreadYield {
    public static void main(String[] args) {
        Thread t = new Thread(new testYield());
        t.run();
    }
    static class testYield implements Runnable {
        int counter = 0;
        @Override
        public void run() {
            counter ++;
            System.out.println("Before yield!" + counter);
            Thread.yield();
            System.out.println("After yield!" + counter);
        }
    }
}
